class Solution:
    def greatestLetter(self, s: str) -> str:
        little_arr = [0]*26
        big_arr = [0]*26
        for c in s:
            asc_num = ord(c)
            if 97 <= asc_num <= 122:   # ord('a')==97
                little_arr[asc_num-97] = 1
            elif 65 <= asc_num <= 90:  # ord('A')==65
                big_arr[asc_num-65] = 1

        for i in range(25, -1, -1):
            if little_arr[i] > 0 and big_arr[i] > 0:
                return chr(i+65)
        return ''


print(Solution().greatestLetter('AbCdEfGhIjK'))
